翻訳と辞書
Words near each other
・ Double Circle (anime)
・ Double Circle (film)
・ Double clarinet
・ Double click (disambiguation)
・ Double closing
・ Double cloth
・ Double Cluster
・ Double clutch
・ Double clutch (technique)
・ Double Clutch (Transformers)
・ Double Clutch (video game)
・ Double Coffee
・ Double Coin
・ Double Cola
・ Double Commander
Double compare-and-swap
・ Double concerto
・ Double Concerto (Brahms)
・ Double Concerto (Delius)
・ Double Concerto for Two String Orchestras, Piano, and Timpani (Martinů)
・ Double cone
・ Double cone (biology)
・ Double Confession
・ Double consciousness
・ Double consonant
・ Double Contact
・ Double contrabass flute
・ Double copula
・ Double coset
・ Double counting


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Double compare-and-swap : ウィキペディア英語版
Double compare-and-swap
Double compare-and-swap (DCAS or CAS2) is an atomic primitive proposed to support certain concurrent programming techniques. DCAS takes two not necessarily contiguous memory locations and writes new values into them only if they match pre-supplied "expected" values; as such, it is an extension of the much more popular compare-and-swap (CAS) operation.
DCAS is sometimes confused with the double-width compare-and-swap (DWCAS) implemented by instructions such as x86 CMPXCHG16B. DCAS, as discussed here, handles two discontiguous memory locations, typically of pointer size, whereas DWCAS handles two adjacent pointer-sized memory locations.
In his doctoral thesis, Michael Greenwald recommended adding DCAS to modern hardware, showing it could be used to create easy-to-apply yet efficient software transactional memory (STM). Greenwald points out that an advantage of DCAS vs CAS is that higher-order (multiple item) CAS''n'' can be implemented in O(''n'') with DCAS, but requires O(''n'' log ''p'') time with unary CAS, where ''p'' is the number of contending processes.〔M. Greenwald. "Non-Blocking Synchronization and System Design". Stanford University Technical Report STAN-CS-TR-99-1624 (). (p. 10 in particular)〕
One of the advantages of DCAS is the ability to implement atomic deques (i.e. doubly linked lists) with relative ease.〔Ole Agesen, David L. Detlefs, Christine H. Flood, Alexander T. Garthwaite, Paul A. Martin, Mark Moir, Nir N. Shavit, and Guy L. Steele Jr. "DCAS-Based Concurrent Deques." Theory of Computing Systems 35, no. 3 (2002): 349-386.〕
More recently, however, it has been shown that an STM can be implemented with comparable properties using only CAS.〔Keir Fraser (2004), "Practical lock-freedom" (UCAM-CL-TR-579.pdf )〕 In general however, DCAS is not a silver bullet: implementing lock-free and wait-free algorithms using it is typically just as complex and error-prone as for CAS.〔Simon Doherty et al., "DCAS is not a silver bullet for nonblocking algorithm design". 16th annual ACM symposium on Parallelism in algorithms and architectures, 2004, pp. 216–224 ().〕
Motorola at one point included DCAS in the instruction set for its 68k series;〔(CAS2 )〕 however, the slowness of DCAS relative to other primitives (apparently due to cache handling issues) led to its avoidance in practical contexts.〔Greenwald, Michael, and David Cheriton. "The synergy between non-blocking synchronization and operating system structure." OSDI '96 Proceedings of the second USENIX symposium on Operating systems design and implementation (1996): 123-136. (particularly section 7.1 "Experimental Implementation")〕 , DCAS is not natively supported by any widespread CPUs in production.
The obvious generalization of DCAS to more than two addresses is sometimes called MCAS (multi-word CAS); MCAS can be implemented by a nestable LL/SC, but such a primitive is not directly available in hardware.〔 MCAS can be implemented in software in terms of DCAS, in various ways. In 2013, Trevor Brown, Faith Ellen, and Eric Ruppert have implemented in software a multi-address LL/SC extension (which they call LLX/SCX) that while being more restrictive than MCAS〔Trevor Brown, Faith Ellen, and Eric Ruppert. "Pragmatic primitives for non-blocking data structures." In Proceedings of the 2013 ACM symposium on Principles of distributed computing, pp. 13-22. ACM, 2013.〕 enabled them, via some automated code generation, to implement one of the best performing concurrent binary search tree (actually a chromatic tree), slightly beating the JDK CAS-based skip list implementation.〔Trevor Brown, Faith Ellen, and Eric Ruppert. "A general technique for non-blocking trees." In Proceedings of the 19th ACM SIGPLAN symposium on Principles and practice of parallel programming, pp. 329-342. ACM, 2014.〕
In general, DCAS can be provided by a more expressive hardware transactional memory.〔Dave Dice, Yossi Lev, Mark Moir, Dan Nussbaum, and Marek Olszewski. (2009) "Early experience with a commercial hardware transactional memory implementation." Sun Microsystems technical report (60 pp.) SMLI TR-2009-180. A short version appeared at ASPLOS’09 . The full-length report discusses how to implement DCAS using HTM in section 5.〕 IBM POWER8 provides a working implementation of transactional memory, while the Intel TSX is disabled in current processors due to an errata. Sun's cancelled Rock processor would have supported it as well.
== References ==


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Double compare-and-swap」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.